console.log("(Client) Hello World!");
function FabricTscShutUp<T=any>(value: unknown): T {return value as T}

type remoteChannelData = {
    type: string,
    data: any
}

const remoteChannelHandlers: {
    [key: string]: (data: remoteChannelData) => void
} = {
    "update_position": (data: remoteChannelData) => {
        UiScreen.getAllScreen()!.find(obj => obj.name === 'screen')!.findChildByName<UiBox>("panel")!.findChildByName<UiText>("pos_display")!.textContent = `位置 ${Math.floor(data.data.x)}, ${Math.floor(data.data.y)}, ${Math.floor(data.data.z)}`
    }
}

remoteChannel.onClientEvent((event: remoteChannelData) => {
    remoteChannelHandlers[event.type](event);
})
setInterval(() => {
    input.lockPointer()
    remoteChannel.sendServerEvent({
        type: "req_update_position"
    })
}, 100)


Promise
